<template>
  <div class="order-checked-main">
    <nav-bar :title="$t('h.NAVBAR_TITLE_WITHDRAW')" >
      <template #right>
        <span class="icon-right" @click="$router.push('/withdrawRecode')">{{$t('h.WITHDRAW_RECORD')}}</span>
      </template>
    </nav-bar>
    <div class="list-box">
      <el-form ref="form" :model="form">
        <el-form-item :label="$t('h.WITHDRAW_METHOD')">
          <el-select style="width: 100%;" v-model="form.region" :placeholder="$t('h.WITHDRAW_METHOD_PLACEHOLDER')">
<!--            <el-option label="BTU" value="shanghai"></el-option>-->
            <el-option label="USDT" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('h.CURRENCY')">
          <el-select style="width: 100%;margin-top: -20px" v-model="form.region" :placeholder="$t('h.CURRENCY_PLACEHOLDER')">
<!--            <el-option label="BTU" value="shanghai"></el-option>-->
            <el-option label="USDT" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="margin-top: -20px" :label="$t('h.BLOCKCHAIN_NETWORK')">
          <div class="network" style="display: flex; justify-content: space-between;gap: 10px">
            <div :class="['box',network === 0?'active':'']" @click="network = 0">
              OMNI
              <div class="checked" v-if="network === 0"><van-icon class="font" style="" name="success" /></div>
            </div>
            <div :class="['box',network === 1?'active':'']" @click="network = 1">
              OMNI
              <div class="checked"  v-if="network === 1"><van-icon class="font" style="" name="success" /></div>
            </div>
          </div>
        </el-form-item>
        <el-form-item style="margin-top: -20px"  :label="$t('h.ADDRESS')">
            <el-input v-model="form.name" :laceholder="$t('h.ADDRESS_PLACEHOLDER')"></el-input>
        </el-form-item>
        <el-form-item style="margin-top: -20px"  :label="$t('h.AMOUNT')">
          <el-input v-model="form.amount" :placeholder="$t('h.AMOUNT_PLACEHOLDER')">
            <template #append>
              <div @click="form.amount = currentBalance">{{$t('h.FULL_BALANCE')}}</div>
            </template>
          </el-input>
          <p class="font-blance">{{$t('h.余额')}}：{{currentBalance}}</p>
          <p class="active-font">
            <span>{{$t('h.ACTUAL_AMOUNT_RECEIVED')}}：100</span>
            <span>{{$t('h.HANDLING_FEE')}}：100</span>
          </p>
        </el-form-item>
        <el-form-item>
          <van-button type="warning" block @click="submit">{{$t('h.SUBMIT')}}</van-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import NavBar from '@/components/NavBar/index.vue';
import {mapGetters} from 'vuex';
import {Toast} from 'vant';
export default {
  name: "index",
  components: {
    NavBar,
  },
  data(){
    return{
      network:0,
      form: {
        amount:'',
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    }
  },
  computed: {
    ...mapGetters(['currentBalance'])
  },
  methods:{
    goBack(){
      this.$router.go(-1)
    },
    submit() {
      Toast.fail(this.$t('h.SUBMIT_SUCCESS'))
    }
  }
}
</script>

<style scoped lang="scss">
.order-checked-main {
  width: 100%;
  background: #ffffff;
  min-height: 100vh;
  .icon-right{
    position: absolute;
    right: 20px !important;
    font-size: 12px;
    color: #aaaaaa;
  }
  .header-main {
    width: 100%;
    height: 45px;
    padding: 15px 0 0 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #fff;

    .left-icon {
      position: absolute;
      left: 20px;
    }

    .center {
      width: 100%;
      height: 45px;
      text-align: center;
      line-height: 45px;
      font-size: 15px;
    }
  }
  .list-box{
    width: 100%;
    padding: 5%;
    box-sizing: border-box;
  }
  .network{
    width: 100%;
    margin-top: 40px;

    .box{
      width: 50%;
      box-sizing: border-box;
      position: relative;
      text-align: center;
      line-height: 40px;
      font-size: 14px;
      height: 40px;
      border: 1px solid #f6f6f6;
      .checked{
        position: absolute;
        width: 30px;
        color: #fff;
        height: 20px;
        right: 0;
        bottom: 0;
        font-size: 14px;
        box-sizing: border-box;
        background: linear-gradient(315deg, #f89220,#f89220 50%,  transparent 0,transparent 50%);
        .font{
          position: absolute;
          top: 5px;
          right: 1px;
        }
      }
    }
    .active{
      border: 1px solid #f89220;
      border-radius: 5px;
    }

  }
  .font-blance{
    font-size: 12px;
    color: #79c642;
  }
  .active-font{
    margin-top: -20px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    span:nth-child(1){
      color: #aaaaaa;
    }
    span:nth-child(2){
      color: #f89220;
    }
  }
}
</style>
